home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_lavabubdash1.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  112 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_LavaBubbles.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     entered
  13.     message     pulse
  14.     
  15.     thing       blurp           local
  16.     thing       bloop0
  17.     thing       bloop1
  18.     thing       bloop2
  19.     thing       bloop3
  20.     thing       bloop4
  21.     
  22.     sector      sec_Start1
  23.     sector      sec_Start2
  24.     sector      sec_Stop1
  25.     sector      sec_Stop2
  26.     
  27.     template    tpl_Bubble=lavabubopp       local
  28.     template    tpl_Sparks=lavasparks       local
  29.  
  30.     material    bubbleSkin=bubble_a4lava_top.mat        local
  31.     material    lavaSkin=gen_a4sfx_lava_particle.mat    local
  32.     
  33.     sound       sfx_Bloop0=gen_lava_bloop_a.wav      local
  34.     sound       sfx_Bloop1=gen_lava_blurp_a.wav      local
  35.     
  36.     int         animId      local
  37.     int         newBubble   local
  38.     int         oldBubble   local
  39.     int         bubbling=0  local
  40.     
  41.     
  42. end
  43.  
  44. # ========================================================================================
  45.  
  46. code
  47.  
  48. entered:
  49.  
  50.     if((GetSenderRef() == sec_Start1) || (GetSenderRef() == sec_Start2))
  51.     {
  52.         if(bubbling == 0)
  53.         {
  54.             Print("startBubbles");
  55.             bubbling = 1;
  56.             #Sleep(0.5);
  57.             SetPulse(1.0);
  58.         }
  59.     }
  60.  
  61.     if((GetSenderRef() == sec_Stop1) || (GetSenderRef() == sec_Stop2))
  62.     {
  63.         Print("stopBubbles");
  64.         SetPulse(0.0);
  65.         bubbling = 0;
  66.     }
  67.     
  68.     return;
  69.  
  70. # ========================================================================================
  71.  
  72. pulse:
  73.  
  74.     while (newBubble == oldBubble) 
  75.     {
  76.         newBubble = RandBetween(0, 4);
  77.     }
  78.     
  79.     oldBubble = newBubble;
  80.     
  81.     # create bubble at random position
  82.     blurp = CreateThing(tpl_Bubble, bloop0[newBubble]);
  83.     CaptureThing(blurp);
  84.     
  85.     # move bubble to frame
  86.     MoveToFrame(blurp, 1, 1.5);
  87.     
  88.     # animate the bubble mat
  89.     SetMaterialCel(bubbleskin, 0);
  90.     animId = MaterialAnim(bubbleskin, 48, 0);
  91.     
  92.     # play the bloop/blurp sfx
  93.     PlaySoundThing(sfx_Bloop0[RandBetween(0, 1)], blurp, 1.0, 10.0, 20.0, 0x0);
  94.     
  95.     # create lava sparks
  96.     SetMaterialCel(lavaskin, 0);
  97.     CreateThing(tpl_Sparks, bloop0[newBubble]);
  98.     MaterialAnim(lavaskin, 4, 0);
  99.     
  100.     # get ready for the next one
  101.     WaitForStop(blurp);
  102.     Sleep(0.45);
  103.     #StopAnim(animId);
  104.     DestroyThing(blurp);
  105.     
  106.     return;
  107.  
  108. # ========================================================================================
  109.  
  110. end
  111.  
  112.